<!DOCTYPE html>
<html>
  <head>
    <% include global/meta.html %>
    <% include global/top-css.html %>
    <title>yuscms</title>
</head>
  <body>
    

        <main class="main" data-info="<%=admin.permission%>">
          <div class="pl-20 pt-10 pb-20 pr-20">
            <div class="row">
              <div class="tongji-num col-6 row mt-10 pd-15 shadow mr-20">
                <i class="ico ico-article"></i>
                <div class="flex">
                  <p class="f-18 mt-4 c-9ca4bf text-c">文档总数</p>
                  <p class="f-16 mt-12 c-9ca4bf text-c">{{articleNum}}</p>
                </div>
              </div>
        
              <div class="tongji-num col-6 row mt-10 pd-15 shadow mr-20">
                <i class="ico ico-message"></i>
                <div class="flex">
                  <p class="f-18 mt-4 c-9ca4bf text-c">留言总数</p>
                  <p class="f-16 mt-12 c-9ca4bf text-c">{{commentNum}}</p>
                </div>
              </div>
        
              <div class="tongji-num col-6 row mt-10 pd-15 shadow mr-20">
                <i class="ico ico-index-user"></i>
                <div class="flex">
                  <p class="f-18 mt-4 c-9ca4bf text-c">注册用户数</p>
                  <p class="f-16 mt-12 c-9ca4bf text-c">{{userNum}}</p>
                </div>
              </div>
        
              <div class="tongji-num col-6 row mt-10 pd-15 shadow">
                <i class="ico  ico-admin"></i>
                <div class="flex">
                  <p class="f-18 mt-4 c-9ca4bf text-c">管理员总数</p>
                  <p class="f-16 mt-12 c-9ca4bf text-c">{{adminNum}}</p>
                </div>
              </div> 
        
            </div>
        
            <div class="row mt-20  c-9ca4bf">
              <div class="pd-15 row shadow mr-20 col-12">
                  <p class="f-18 c-9ca4bf"><span class="mr-35">上次登录时间</span> <span class="f-16">{{info.last_time}}</span></p>
              </div>
        
              <div class="pd-15 row shadow col-12">
                <p class="f-18 c-9ca4bf"><span class="mr-35">上次登录IP</span><span class="f-16">{{info.last_ip || '127.0.0.1'}}</span></p>
              </div>
            </div>   
        
            <div class="row mt-20  c-9ca4bf">
              <div class="col-12 flex-wrap row shadow mr-20">
                <div class="col-12 text-c ">
                  <p class="f-18 mt-35"> 程序支持</p>
                  <p class="f-16 mt-25">官网</p>
                  <p class="f-16 mb-35"><a class="c-9ca4bf" href="http://www.yuscms.com" target="_blank">www.yuscms.com</a></p>
                </div>
        
               <div class="col-12 text-c ">
                  <p class="f-18 mt-35"> 程序架构</p>
                  <p class="f-14 mt-25"> 后台：es6, node8+, express4+,ejs, mysql5.3<br/>
                  前台：vue2,vue-router,webpack,axious</p>
              </div>
        
              <div class="col-12 text-c">
                <p class="f-18 mt-35"> 程序版本</p>
                <p class="f-16 mt-25 mb-35">0.0.0.1 (2017-12-22)</p>
              </div>
        
              <div class="col-12 text-c">
                <p class="f-18 mt-35">最新版本<i class="ico ico-tip pos-r t-1"></i></p>
                <a href="" class="btn mb-35  mt-20 f-16 c-fff bg-ffb33d pt-6 pb-6 pl-30 pr-30 r-18">检查版本</a>
              </div>
        
            </div>
        
        
            <div class="col-12 row shadow flex-wrap">
              <div class="col-12 text-c ">
                <p class="f-18 mt-35"> 开发团队</p>
                 <p class="f-14 mt-25">UI设计师：16hao<br/>
                  前端&后台：明空</p>
                 <p class="f-16 mt-20"></p>
              </div>
              <div class="col-12 text-c ">
                <p class="f-18 mt-35"> 官方QQ群</p>
                <p><img src="/static/admin/img/qun.png"></a></p>
                <p class="f-16 mb-5">340156252</p>
              </div>
              <div class="col-24 text-c ">
                <p class="f-18 mt-35">帮助中心</p>
                <p class="f-16 mt-25 mb-35"><a class="c-9ca4bf" href="http://www.yuscms.com" target="_blank">www.yuscms.com</a></p>
              </div>
            </div>
         </div>  
          </div> 
        </main>


  <% include global/all-js.html %>
	<script>
		var vm = new Vue({
			el:'.main',
			data:{
        adminNum:0,
        articleNum:0,
        commentNum:0,
        userNum:0,
        info:{},
			},
			methods:{
      getData(){
        var _this = this;
        axios.get('/api/admin/index').then((data)=>{
          var filterData = data.data;
          if(filterData.success){
              _this.adminNum = filterData.data.adminNum[0].count;
              _this.articleNum = filterData.data.articleNum[0].count;
              _this.commentNum = filterData.data.commentNum[0].count;
              _this.userNum = filterData.data.userNum[0].count;
              _this.info = filterData.data.info[0];
          }
        }).catch((error)=>{
          console.error(error)
        });
      }
			},
			created:function(){
        this.getData();
			},
			mounted:function(){
			},
			updated:function(){
			}
    });
	</script>	
	</body>
</html>
